package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.JhjsSixMapper;
import com.ruoyi.control.domain.JhjsSix;
import com.ruoyi.control.service.IJhjsSixService;

/**
 * 406机巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class JhjsSixServiceImpl extends ServiceImpl<JhjsSixMapper, JhjsSix> implements IJhjsSixService //修改
{
    @Autowired
    private JhjsSixMapper jhjsSixMapper;

    /**
     * 查询406机巷局扇
     * 
     * @param tagName 406机巷局扇主键
     * @return 406机巷局扇
     */
    @Override
    public JhjsSix selectJhjsSixByTagName(String tagName)
    {
        return jhjsSixMapper.selectJhjsSixByTagName(tagName);
    }

    /**
     * 查询406机巷局扇列表
     * 
     * @param jhjsSix 406机巷局扇
     * @return 406机巷局扇
     */
    @Override
    public List<JhjsSix> selectJhjsSixList(JhjsSix jhjsSix)
    {
        return jhjsSixMapper.selectJhjsSixList(jhjsSix);
    }

    /**
     * 新增406机巷局扇
     * 
     * @param jhjsSix 406机巷局扇
     * @return 结果
     */
    @Override
    public int insertJhjsSix(JhjsSix jhjsSix)
    {
        return jhjsSixMapper.insertJhjsSix(jhjsSix);
    }

    /**
     * 修改406机巷局扇
     * 
     * @param jhjsSix 406机巷局扇
     * @return 结果
     */
    @Override
    public int updateJhjsSix(JhjsSix jhjsSix)
    {
        jhjsSix.setUpdateTime(DateUtils.getNowDate());
        return jhjsSixMapper.updateJhjsSix(jhjsSix);
    }

    /**
     * 批量删除406机巷局扇
     * 
     * @param tagNames 需要删除的406机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsSixByTagNames(String[] tagNames)
    {
        return jhjsSixMapper.deleteJhjsSixByTagNames(tagNames);
    }

    /**
     * 删除406机巷局扇信息
     * 
     * @param tagName 406机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsSixByTagName(String tagName)
    {
        return jhjsSixMapper.deleteJhjsSixByTagName(tagName);
    }
    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<JhjsSix> getList() {
        List<JhjsSix> jhjsSixList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            JhjsSix jhjsSix = jhjsSixMapper.selectJhjsSixByTagName(fanDatum);
            jhjsSixList.add(jhjsSix);
        }
        return jhjsSixList;
    }
}
